#define _CRT_SECURE_NO_WARNINGS
#include <iostream>
#include <vector>
#include <set>
#include <algorithm>

using namespace std;

class Solution {
public:

    int MLS(vector<int>& arr) {

        sort(arr.begin(), arr.end());
        unique(arr.begin(), arr.end());
        int right = 1;
        int left = 0;
        int ret = 1;

        while (right < arr.size())
        {
            if (arr[right] == arr[right - 1] + 1)
            {
                ret = max(ret, right - left + 1);
            }
            else {
                left = right;
            }
            right++;
        }

        return ret;
    }
};
int main()
{
    vector<int> arr = { 1,2,2,3,5,6 };
    set<int> s(arr.begin(), arr.end());
    for(auto it = s.begin();it != s.end();it++)
    {
        cout << *it << " ";
    }
	return 0;
}